package wechat

type WechatReq struct {
	AgentID string `json:"agent_id" comment:"appid"`
	CorpId  string `json:"corp_id" comment:"企业id"`
	//CorpSecret string `json:"corp_secret"  comment:"企业密钥"`
}

type GetWechatCallBack struct {
	MsgSignature string `json:"msg_signature" comment:"消息签名"`
	Timestamp    string `json:"timestamp" comment:"时间戳"`
	Nonce        string `json:"nonce" comment:"随机数"`
	Echostr      string `json:"echostr" comment:"信息体"`
	ToUserName   string `xml:"ToUserName" comment:"消息签名"`
	AgentID      string `xml:"AgentID" comment:"应用id"`
	Encrypt      string `xml:"Encrypt" comment:"时间戳"`
	AuthCode     string `xml:"AuthCode" comment:"临时授权码"`
	InfoType     string `xml:"InfoType" comment:"授权类型"`
	Method       string
}

type WechatCallBackRes struct {
	SuiteId     string `json:"msg_signature" comment:"消息签名"`
	InfoType    string `json:"timestamp" comment:"时间戳"`
	TimeStamp   string `json:"nonce" comment:"时间戳"`
	SuiteTicket string `json:"echostr" comment:"ticket"`
}

type GetSuiteAccessTokenReq struct {
	SuiteId     string `json:"suite_id"`
	SuiteSecret string `json:"suite_secret"`
	SuiteTicket string `json:"suite_ticket"`
}

type GetPreCode struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
}

type GetPermanentCode struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
	AuthCode         string `json:"auth_code" comment:"临时授权码"`
}

type GetPermanentCodeRes struct {
	PermanentCode string `json:"permanent_code" comment:"token"`
	CorpId        string `json:"corp_id" comment:"加密企业id"`
	AgentId       int64  `json:"agent_id" comment:"企业授权id"`
}

type GetCorpToken struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
	PermanentCode    string `json:"permanent_code" comment:"临时授权码"`
	CorpId           string `json:"auth_corpid" comment:"企业id"`
}

type GetCorpTokenRes struct {
	CorpToken string `json:"corp_token" comment:"token"`
	AgentId   string `json:"agent_id" comment:"企业id"`
}

type GetApiTicket struct {
	CorpToken string `json:"corp_token" comment:"企业凭证"`
	CorpId    string `json:"auth_corpid" comment:"企业id"`
}

type GetSignature struct {
	ApiTicket string `json:"api_ticket" comment:"ApiTicket"`
	Url       string `json:"url" comment:"url"`
	Timestamp string `json:"timestamp" comment:"时间戳"`
	Nonce     string `json:"nonce" comment:"随机数"`
}

type GetSignatureRes struct {
	ApiTicket string `json:"api_ticket" comment:"ApiTicket"`
	NonceStr  string `json:"nonce_str" comment:"随机字符串"`
	Timestamp string `json:"timestamp" comment:"时间戳"`
	Url       string `json:"url" comment:"url"`
	Signature string `json:"signature" comment:"url"`
}

type GetLoginInfo struct {
	ProvideAccessToken string `json:"provider_access_token" comment:"供应商token"`
	AuthCode           string `json:"auth_code" comment:"认证code"`
}

type LogInfo struct {
	Errcode  int      `json:"errcode"`
	Errmsg   string   `json:"errmsg"`
	Usertype int      `json:"usertype"`
	UserInfo UserInfo `json:"user_info"`
	CorpInfo CorpInfo `json:"corp_info"`
	Agent    []Agent  `json:"agent"`
	AuthInfo AuthInfo `json:"auth_info"`
}

type UserInfo struct {
	Userid     string `json:"userid"`
	OpenUserid string `json:"open_userid"`
	Name       string `json:"name"`
	Avatar     string `json:"avatar"`
}

type CorpInfo struct {
	Corpid string `json:"corpid"`
}

type AuthInfo struct {
	Department []Department `json:"department"`
}

type Department struct {
	Id       int  `json:"id"`
	Writable bool `json:"writable"`
}

type Agent struct {
	Agentid  int `json:"agentid"`
	AuthType int `json:"auth_type"`
}

type GetWeChatInfo struct {
	AgentId        string `json:"agent_id" comment:""`
	AgentIdForScan string `json:"agent_id_for_scan" comment:""`
}

type SetAuthCode struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
	PreAuthCode      string `json:"pre_auth_code" comment:"临时授权码"`
	AuthType         int    `json:"auth_type" comment:""`
}
type SessionInfo struct {
	AppId    []string `json:"appid" comment:""`
	AuthType int      `json:"auth_type" comment:""`
}

type GetUserInfo struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
	Code             string `json:"code" comment:"通过成员授权获取到的code"`
}

type GetUserInfoRes struct {
	OpenId     string `json:"openid"`
	CorpId     string `json:"corpid"`
	UserId     string `json:"userid"`
	UserTicket string `json:"user_ticket"`
	ExpiresIn  int    `json:"expires_in"`
	OpenUserid string `json:"open_userid"`
	TenantId   string `json:"tenant_id" comment:"租户"`
}

type GetSpecialUserInfo struct {
	SuiteAccessToken string `json:"suite_access_token" comment:"token"`
	UserTicket       string `json:"user_ticket"`
}

type GetSpecialUserInfoRes struct {
	CorpId string `json:"corpid"`
	UserId string `json:"userid"`
	Name   string `json:"name"`
	Gender string `json:"gender"`
	Avatar string `json:"avatar"`
	QrCode string `json:"qr_code"`
}

type GetWechatTokenReq struct {
	AppId     string `json:"app_id" comment:"appid"`
	Secret    string `json:"secret" comment:"密钥"`
	Code      string `json:"code"  comment:"code"`
	Timestamp string `json:"timestamp" comment:"时间戳"`
	Nonce     string `json:"nonce" comment:"随机数"`
	Url       string `json:"url" comment:"地址"`
}

type AccessTokenInfo struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Openid       string `json:"openid"`
	Scope        string `json:"scope"`
	Unionid      string `json:"unionid"`
}

type GetWechatUserInfoReq struct {
	AccessToken string `json:"access_token" comment:"token"`
	OpenId      string `json:"open_id" comment:"open_id"`
}

type WechatUserInfo struct {
	Openid     string   `json:"openid"`
	Nickname   string   `json:"nickname"`
	Sex        int      `json:"sex"`
	Province   string   `json:"province"`
	City       string   `json:"city"`
	Country    string   `json:"country"`
	Headimgurl string   `json:"headimgurl"`
	Privilege  []string `json:"privilege"`
	Unionid    string   `json:"unionid"`
}

type RefreshTokenReq struct {
	AppId        string `json:"app_id" comment:"appid"`
	RefreshToken string `json:"refresh_token" comment:"token"`
	Code         string `json:"code"  comment:"code"`
}

type ShareTicket struct {
	Errcode   int    `json:"errcode"`
	Errmsg    string `json:"errmsg"`
	Ticket    string `json:"ticket"`
	ExpiresIn int    `json:"expires_in"`
}

type ToOpenCorpIdReq struct {
	CorpId string `json:"corp_id" comment:"corp_id"`
}

type ToOpenCorpId struct {
	OpenCorpId string `json:"open_corpid"`
}
